import request from '../utils/request.js'

/**
 * 判断当前用户名是否已经存在
 */
export const existUsernameAPI = (username) => request.post('/login/existUsername', {
    username
})

/**
 * 注册用户的信息写入数据库
 */
export const registerUserAPI = (username, password, email) => request.post('/login/registerUser', {
    username,
    password,
    email
})

/**
 * 登录
 */
export const loginAPI = (username, password) => request.post('/login/login', {
    username,
    password,
})

// 退出登录
export const logoutAPI = (user_id) => request.get('/login/logout', {
    user_id
})